<?php
include 'sys/db.class.php';

include "config.php";
//连接数据库
DB::connect($dbconfig['host'],$dbconfig['user'],$dbconfig['pwd'],$dbconfig['dbname'],$dbconfig['port']);
include 'sys/function.php';
if (!isset($_GET['s'])) {die("缺少参数！");}
$s = $_GET['s'];

switch ($s) {
	case 'add':
		if (!isset($_POST['name1'])) {die("缺少参数！");}
		if (!isset($_POST['name2'])) {die("缺少参数！");}
		if (!isset($_POST['info'])) {die("缺少参数！");}
		add($_POST['name1'],$_POST['name2'],$_POST['info']);
		break;
	case 'search':
		if (!isset($_GET['name'])) {die("缺少参数！");}
		search($_GET['name']);
		break;
	case 'see':
		see($_GET['page']);
		break;
	case 'like':
		like($_GET['id']);
		break;
	case 's':
		s();
		break;
	case 'set':
		set();
		break;
	case 'login':
		login();
		break;
	default:
		echo '操作不对！';
		break;
}